package org.minuframework.file.upload.spring;

import java.io.File;

import org.minuframework.file.upload.DefaultFileBuilder;
import org.minuframework.file.upload.FileParamerConfigurer;
import org.minuframework.file.upload.FileTypesConfigurer;

@Deprecated
public final class FileUploadBuilder extends DefaultFileBuilder {
    public FileUploadBuilder getParamerRepository() {
        super.getParamerRepository();
        return this;
    }
    
    public FileUploadBuilder setCharset(String charset) {
        this.charset = charset;
        return this;
    }
    
    public FileUploadBuilder setMinuConfigurerPathname(String minuConfigurerPathname) {
        this.minuConfigurerPathname = minuConfigurerPathname;
        return this;
    }
    
    public FileUploadBuilder setMimeTypeConfigurerPathname(String mimeTypeConfigurerPathname) {
        this.mimeTypeConfigurerPathname = mimeTypeConfigurerPathname;
        return this;
    }
    
    public FileUploadBuilder setMimeTypeConfigurerFile(File mimeTypeConfigurerFile) {
        this.mimeTypeConfigurerFile = mimeTypeConfigurerFile;
        return this;
    }
    
    public FileUploadBuilder setMinuConfigurerFile(File minuConfigurerFile) {
        this.minuConfigurerFile = minuConfigurerFile;
        return this;
    }
    
    public FileUploadBuilder setFileParamerConfigurer(FileParamerConfigurer fileParamerConfigurer) {
        this.fileParamerConfigurer = fileParamerConfigurer;
        return this;
    }
    
    public FileUploadBuilder setFileTypesConfigurer(FileTypesConfigurer fileTypesConfigurer) {
        this.fileTypesConfigurer = fileTypesConfigurer;
        return this;
    }
    
    private FileUpload createFileUpload() {
        return new FileUpload(this.fileParamerConfigurer, this.fileTypesConfigurer, this.charset);
    }
    
    public FileUpload create() {
        return getParamerRepository().createFileUpload();
    }
}
